﻿/********************************************************************************
** @ Date:2025/05/21
** @ Author: Gaojia
** @ Description:
** @ Version:1.0.0
** @ Fun:
********************************************************************************/
#ifndef CRobCtrMange_H
#define CRobCtrMange_H
#include "CRobCtrOper.h"
#include "CDevDataBase.h"
#include <qobject.h>
#include <qtimerevent>
#include <qeventloop.h>
#include <qtimer.h>
class CRobCtrMange :public QObject
{
	Q_OBJECT
public:
	CRobCtrMange(CDevDataBase *pDevDataRob);
	~CRobCtrMange();
	void threadRun();
	void threadStop();
	bool ctrDevice(SCtrInfo& stCtrInfo);
protected:
	void timerEvent(QTimerEvent * event)override;
private:
	CRobCtrOper *m_pRobCtrOper; //设备操作类对象
	CDevDataBase *m_pDevDataRob; //巡检机器人数据类
	QVector<SCtrInfo>m_vecCtrQueue;
	QThread  *m_pThread;        //异步工作线程
	bool      m_bhread;         //异步线程状态
	QMutex   *m_pMutex;
	int m_nGetDevDataTimer;     //获取设备数据定时器
	int m_nWriteCsvLogTimer;	//实时写设备csv信息定时器
private slots:
	void slot_ThreadWork();
};

#endif